package com.vict.bean.app.appbase.ao;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.vict.enums.app.Platform;
import com.vict.framework.fastjsonserializer.EnumDeserializer;
import com.vict.framework.fastjsonserializer.EnumSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class CheckUpdateAO {

    @ApiModelProperty("平台 Android IOS")
    @JSONField(serializeUsing = EnumSerializer.class, deserializeUsing = EnumDeserializer.class)
    private Platform platform;

    private String nowVersion;

    private String updateVersion;

    public void check(){
        if(platform == null){
            throw new RuntimeException("平台不能为空");
        }
        if(nowVersion == null){
            throw new RuntimeException("当前版本号不能为空");
        }
        if(updateVersion == null){
            throw new RuntimeException("最新版本号不能为空");
        }
    }
}
